package com.uco.sample;

public class ControlTest {
    public static void main(String[] args) {
        int year = calc();
        System.out.println(year);
    }

    // 本金 10w，年利率1.13%，计算多久能实现本金翻倍
    public static int calc() {
        double init_money = 100000;
        double money = init_money;
        double rate = 1.13;
        int year = 0;
//        for (;money < 2 * init_money;) {
//        }
//
        while (money < 2 * init_money) {
            money = (money * (1 + rate / 100));
            year++;
        }
        return year;
    }
}
